<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="lxh.css">
    <link rel="stylesheet" href="orange.css">
    <title>Document</title>
    <style>
        div{
            width: 800px;
            height: 600px;
            border: 1px solid black;
            margin: 50px auto;
            position: relative;
        }
        p{
            margin: 0;
            width: 150px;
            height: 73px;
            border: 1px solid black;
            border-bottom-right-radius: 10px;
            border-top-right-radius: 10px;
            text-align: center;
            line-height: 75px;
            font-weight: bold;
            color: white;
        }
        p:nth-of-type(1){
            background: pink;
        }
          p:nth-of-type(2){
            background: lightblue;
        }
         p:nth-of-type(3){
            background: lightseagreen;
        }
         p:nth-of-type(4){
            background: slateblue;
        }
         p:nth-of-type(5){
            background: orange;
        }
         p:nth-of-type(6){
            background: brown;
        }
         p:nth-of-type(7){
            background: cornflowerblue;
        }
         p:nth-of-type(8){
            background: chocolate;
        }
        section{
            width: 650px;
            height: 600px;
            position: absolute;
            top:0px;
            left: 150px;
        }
    </style>
</head>
<body>
    <div>
        <p>pink</p>
        <p>lightblue</p>
        <p>lightseagreen</p>
        <p>slateblue</p>
        <p>orange</p>
        <p>brown</p>
        <p>cornflowerblue</p>
        <p>chocolate</p>
        <section></section>
    </div>
</body>
</html>
<script>
    var p = document.querySelectorAll('p');
    var sec = document.querySelector('section')
     p[0].addEventListener("mouseover",function(){
         sec.style.backgroundColor = 'pink';
     })
     p[1].addEventListener("mouseover",function(){
         sec.style.backgroundColor = 'lightblue';
     })

      p[2].addEventListener("mouseover",function(){
         sec.style.backgroundColor = 'lightseagreen';
     })

     p[3].addEventListener("mouseover",function(){
         sec.style.backgroundColor = 'slateblue';
     })

//      p[4].addEventListener("mouseover",function(){
// //         sec.style.backgroundColor = 'orange';
//      })

     p[5].addEventListener("mouseover",function(){
         sec.style.backgroundColor = 'brown';
     })

     p[6].addEventListener("mouseover",function(){
         sec.style.backgroundColor = 'cornflowerblue';
     })
</script>
<script src="lxh.js"></script>
</script>
<script src="orange.js"></script>
